/**
 * Copyright 2018 orivil.com. All rights reserved.
 * Use of this source code is governed by a MIT-style
 * license that can be found at https://mit-license.org.
 */

package main

import (
	"net/http"
	"fmt"
	"os"
	"log"
	"gitee.com/tugoer/examples/projects/param/code"
)

func main() {

	// handle POST 数据
	http.Handle("/param", code.FormHandler)

	// 响应静态页面
	http.Handle("/", code.HtmlHandler("/param"))
	port := ":8080"
	fmt.Fprintf(os.Stdout, "listen and serve: http://localhost%s\n", port)
	log.Fatal(http.ListenAndServe(port, nil))
}
